<?php
/**
 * Created by PhpStorm.
 * User: zhangrxiang
 * Date: 2017/7/17
 * Time: 13:50
 * Project name: PHPTEST
 * File name: 2.php
 * @copyright Copyright (c) 2016 ZRX Software LLC
 * @license https://github.com/zhangrxiang
 * @since 1.0.0
 */

//* Applies the callback to the elements of the given arrays
$a  = [ 1, 2, 3, 4, 5, 6 ];
$a3 = [ 6, 5, 4, 3, 2, 1 ];
$a2 = array_map( function ( $val ) {
	return $val * 2;
}, $a );

var_dump( $a2 );

$a4 = array_map( function ( $v1, $v2 ) use ( $a ) {
	return $v1 * $v2;
}, $a, $a3 );
var_dump( $a4 );


echo stripslashes( "(\' becomes ' and so on.)\n" );
echo stripslashes( "(\' becomes ' and so on.)\'\\" );
echo stripslashes( "\z\x\c\q\----...----!!!@@@###$$%%^b\b\m\m" );


var_dump( array_combine( [ 'a', 'b', 'c' ], [ 3, 2, 1 ] ) );